In [1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as px
import warnings
warnings.filterwarnings("ignore")
In [2]:
df_swiggy= pd.read_csv("Swiggy Bangalore Outlet Details.csv")
df_swiggy.head()
Out[2]:
| Shop_Name | Cuisine | Location | Rating | Cost_for_Two | |
|---|---|---|---|---|---|
| 0 | Kanti Sweets | Sweets | Koramangala, Koramangala | 4.3 | ₹ 150 |
| 1 | Mumbai Tiffin | North Indian, Home Food, Thalis, Combo | Sector 5, HSR | 4.4 | ₹ 400 |
| 2 | Sri Krishna sagar | South Indian, North Indian, Fast Food, Beverag... | 6th Block, Koramangala | 4.1 | ₹ 126 |
| 3 | Al Daaz | American, Arabian, Chinese, Desserts, Fast Foo... | HSR, HSR | 4.4 | ₹ 400 |
| 4 | Beijing Bites | Chinese, Thai | 5th Block, Koramangala | 4.1 | ₹ 450 |
In [3]:
# how many features are there in data sets
df_swiggy.columns
Out[3]:
Index(['Shop_Name', 'Cuisine', 'Location', 'Rating', 'Cost_for_Two'], dtype='object')
In [4]:
# check for missing values in dataset
df_swiggy.isnull().sum()
Out[4]:
Shop_Name 0 Cuisine 0 Location 0 Rating 0 Cost_for_Two 0 dtype: int64
In [5]:
df_swiggy.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 118 entries, 0 to 117 Data columns (total 5 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Shop_Name 118 non-null object 1 Cuisine 118 non-null object 2 Location 118 non-null object 3 Rating 118 non-null object 4 Cost_for_Two 118 non-null object dtypes: object(5) memory usage: 4.7+ KB
In [6]:
df_swiggy.describe(include="all") # element ,repeat,unqiue,how mant times
Out[6]:
| Shop_Name | Cuisine | Location | Rating | Cost_for_Two | |
|---|---|---|---|---|---|
| count | 118 | 118 | 118 | 118 | 118 |
| unique | 115 | 79 | 65 | 13 | 30 |
| top | La Pino'z Pizza | North Indian | BTM, BTM | 4.1 | ₹ 300 |
| freq | 2 | 12 | 13 | 30 | 16 |
In [7]:
df_swiggy.duplicated().sum()
Out[7]:
0
In [8]:
df_swiggy["Rating"].unique()
Out[8]:
array(['4.3', '4.4', '4.1', '4.2', '3.9', '3.8', '4', '3.7', '3.6', '4.8',
'4.5', '4.6', '--'], dtype=object)
In [9]:
# Replace "--" rating with zero
df_swiggy["Rating"]=df_swiggy["Rating"].str.replace("--","0").astype(float)
In [10]:
df_swiggy["Rating"]
Out[10]:
0 4.3
1 4.4
2 4.1
3 4.4
4 4.1
...
113 3.9
114 4.1
115 4.2
116 4.3
117 4.2
Name: Rating, Length: 118, dtype: float64
In [11]:
# How many unique entries for"Cost_for_Two" Future
df_swiggy["Cost_for_Two"].unique()
Out[11]:
array(['₹ 150', '₹ 400', '₹ 126', '₹ 450', '₹ 350', '₹ 200', '₹ 500',
'₹ 247', '₹ 550', '₹ 300', '₹ 129', '₹ 250', '₹ 268', '₹ 600',
'₹ 527', '₹ 130', '₹ 257', '₹ 280', '₹ 399', '₹ 220', '₹ 800',
'₹ 100', '₹ 178', '₹ 120', '₹ 251', '₹ 650', '₹ 132', '₹ 153',
'₹ 219', '₹ 193'], dtype=object)
In [12]:
df_swiggy["Cost_for_Two"]=df_swiggy["Cost_for_Two"].apply(lambda x:int(x.strip("₹ ")))
In [13]:
df_swiggy["Cost_for_Two"].dtype
Out[13]:
dtype('int64')
In [14]:
df_swiggy.head()
Out[14]:
| Shop_Name | Cuisine | Location | Rating | Cost_for_Two | |
|---|---|---|---|---|---|
| 0 | Kanti Sweets | Sweets | Koramangala, Koramangala | 4.3 | 150 |
| 1 | Mumbai Tiffin | North Indian, Home Food, Thalis, Combo | Sector 5, HSR | 4.4 | 400 |
| 2 | Sri Krishna sagar | South Indian, North Indian, Fast Food, Beverag... | 6th Block, Koramangala | 4.1 | 126 |
| 3 | Al Daaz | American, Arabian, Chinese, Desserts, Fast Foo... | HSR, HSR | 4.4 | 400 |
| 4 | Beijing Bites | Chinese, Thai | 5th Block, Koramangala | 4.1 | 450 |
In [15]:
df_swiggy.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 118 entries, 0 to 117 Data columns (total 5 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Shop_Name 118 non-null object 1 Cuisine 118 non-null object 2 Location 118 non-null object 3 Rating 118 non-null float64 4 Cost_for_Two 118 non-null int64 dtypes: float64(1), int64(1), object(3) memory usage: 4.7+ KB
In [16]:
df_swiggy.describe()
Out[16]:
| Rating | Cost_for_Two | |
|---|---|---|
| count | 118.000000 | 118.000000 |
| mean | 4.061864 | 321.008475 |
| std | 0.430845 | 137.286804 |
| min | 0.000000 | 100.000000 |
| 25% | 4.000000 | 204.750000 |
| 50% | 4.100000 | 300.000000 |
| 75% | 4.300000 | 400.000000 |
| max | 4.800000 | 800.000000 |
In [17]:
# Distribution of Ratings":
df_valid_Ratings= df_swiggy[df_swiggy["Rating"]>0]
df_valid_Ratings
Out[17]:
| Shop_Name | Cuisine | Location | Rating | Cost_for_Two | |
|---|---|---|---|---|---|
| 0 | Kanti Sweets | Sweets | Koramangala, Koramangala | 4.3 | 150 |
| 1 | Mumbai Tiffin | North Indian, Home Food, Thalis, Combo | Sector 5, HSR | 4.4 | 400 |
| 2 | Sri Krishna sagar | South Indian, North Indian, Fast Food, Beverag... | 6th Block, Koramangala | 4.1 | 126 |
| 3 | Al Daaz | American, Arabian, Chinese, Desserts, Fast Foo... | HSR, HSR | 4.4 | 400 |
| 4 | Beijing Bites | Chinese, Thai | 5th Block, Koramangala | 4.1 | 450 |
| ... | ... | ... | ... | ... | ... |
| 113 | Wok Paper Scissors | Pan-Asian, Chinese, Asian | JNC Road, Koramangala | 3.9 | 219 |
| 114 | Savoury Restaurant | Arabian, Middle Eastern, North Indian, Grill, ... | Madiwala, BTM | 4.1 | 600 |
| 115 | Royal Treat | North Indian, Chinese, Seafood, Biryani | 5th block Koramangala, Koramangala | 4.2 | 193 |
| 116 | Thali 99 | North Indian | Koramangala, Koramangala | 4.3 | 200 |
| 117 | Mani's Dum Biryani | Andhra, Biryani | 1st Block, Koramangala | 4.2 | 400 |
117 rows × 5 columns
In [18]:
# Distribution of "Ratings":
sns.distplot(df_valid_Ratings["Rating"])
Out[18]:
<Axes: xlabel='Rating', ylabel='Density'>
In [19]:
# Handling Feature --> Location
df_swiggy["Location"].unique()
Out[19]:
array(['Koramangala, Koramangala', 'Sector 5, HSR',
'6th Block, Koramangala', 'HSR, HSR', '5th Block, Koramangala',
'Koramangala 4th Block, Koramangala', 'BTM 2nd Stage, BTM',
'BTM, BTM', '9th Main road, Koramangala', 'outer ring road, BTM',
'7th Block, Koramangala', '1st MAin, Koramangala',
'Bommanahalli, BTM', '6th block, Koramangala', 'Sector 4, HSR',
'BTM 1st stage, BTM', 'Jakkasandra Extn, Koramangala',
'Marutinagar Main Road, BTM', '1st Block, Koramangala',
'4th Cross, BTM', 'koramangala, Koramangala', 'BTM 2nd stage, BTM',
'3rd main, BTM', 'HSR 1st sector, HSR', 'Sector 7, HSR',
'3rd Sector, HSR', 'Chocolate Factory Road, BTM',
'16th Main Road, 2nd Stage, BTM', '1st Stage, BTM',
'Hosur Main Road, Koramangala',
'1st Cross Road, 5th Block, Near Jyothi Nivas College, Koramangala',
'Mico Layout, BTM', '4th Cross, Koramangala',
'4th Block, Koramangala', 'Intermediate Ring Road, Koramangala',
'3rd sector, HSR', '8TH BLOCK, Koramangala',
'4th b cross, Koramangala', 'SG palaya, BTM',
"Venkatapura Main Rd, Teacher's Colony, Jakkasandra, HSR",
'KHB Colony, Koramangala', 'Sector 3, HSR',
'Bannerghatta Road, Jayanagar',
'80 Feet Peripheral Road, Koramangala', 'Btm, BTM',
'Near Wipro Park Signal, Koramangala', '16th Main Road, BTM',
'2nd Stage, BTM', 'Kuvempu Nagar, Stage 2, BTM',
'Koramangala 1st block, Koramangala',
'5th Block Kormangala, Koramangala', 'Koramangla, Koramangala',
'5th block, Koramangala', '9th Main Rd, Sector 6, HSR Layout, HSR',
'Jay Bheema Nagar, BTM', 'Koramangala 6th block, Koramangala',
'Maruthi Nagar, BTM', 'Sector 6, HSR',
'Jakkasandra Village, Koramangala', '4th block, Koramangala',
'Madiwala Junction, BTM', 'kormangala, Koramangala',
'JNC Road, Koramangala', 'Madiwala, BTM',
'5th block Koramangala, Koramangala'], dtype=object)
In [20]:
# Location that contains "koramangla"
swiggy_Koramangala= df_swiggy[df_swiggy["Location"].str.contains("Koramangala")]
swiggy_Koramangala
Out[20]:
| Shop_Name | Cuisine | Location | Rating | Cost_for_Two | |
|---|---|---|---|---|---|
| 0 | Kanti Sweets | Sweets | Koramangala, Koramangala | 4.3 | 150 |
| 2 | Sri Krishna sagar | South Indian, North Indian, Fast Food, Beverag... | 6th Block, Koramangala | 4.1 | 126 |
| 4 | Beijing Bites | Chinese, Thai | 5th Block, Koramangala | 4.1 | 450 |
| 5 | Kitchens of Punjab | North Indian | Koramangala 4th Block, Koramangala | 4.2 | 350 |
| 9 | Yumlane Pizza | Pizzas, Italian, Mexican | 9th Main road, Koramangala | 3.8 | 150 |
| ... | ... | ... | ... | ... | ... |
| 112 | Kritunga | Andhra, Biryani | 5th Block, Koramangala | 3.9 | 500 |
| 113 | Wok Paper Scissors | Pan-Asian, Chinese, Asian | JNC Road, Koramangala | 3.9 | 219 |
| 115 | Royal Treat | North Indian, Chinese, Seafood, Biryani | 5th block Koramangala, Koramangala | 4.2 | 193 |
| 116 | Thali 99 | North Indian | Koramangala, Koramangala | 4.3 | 200 |
| 117 | Mani's Dum Biryani | Andhra, Biryani | 1st Block, Koramangala | 4.2 | 400 |
64 rows × 5 columns
In [21]:
swiggy_HSR=df_swiggy[df_swiggy["Location"].str.contains("HSR")]
swiggy_HSR
Out[21]:
| Shop_Name | Cuisine | Location | Rating | Cost_for_Two | |
|---|---|---|---|---|---|
| 1 | Mumbai Tiffin | North Indian, Home Food, Thalis, Combo | Sector 5, HSR | 4.4 | 400 |
| 3 | Al Daaz | American, Arabian, Chinese, Desserts, Fast Foo... | HSR, HSR | 4.4 | 400 |
| 8 | Hotel Manu | South Indian, Kerala, Chinese, North Indian | HSR, HSR | 4.1 | 350 |
| 19 | Shree Khana Khazana | Indian, Rajasthani | Sector 4, HSR | 4.1 | 350 |
| 24 | New Udupi Grand | Chinese, Jain, North Indian, South Indian | HSR, HSR | 4.3 | 150 |
| 36 | Biriyani Zone | North Indian, Chinese, Biryani | HSR 1st sector, HSR | 4.1 | 600 |
| 37 | Gongura's | North Indian, Chinese, Biryani | Sector 7, HSR | 3.8 | 300 |
| 39 | Leon Grill | Turkish, Portuguese, American | 3rd Sector, HSR | 4.3 | 300 |
| 41 | Cakewala | Desserts | HSR, HSR | 4.3 | 450 |
| 57 | Donne Biriyani House | South Indian | 3rd sector, HSR | 4.0 | 300 |
| 58 | Nanda's | Andhra, Biryani | HSR, HSR | 4.0 | 400 |
| 61 | Cake Garden | Desserts, Bakery | HSR, HSR | 3.9 | 250 |
| 71 | Nizams Biryani | Biryani, Juices, Kebabs | Venkatapura Main Rd, Teacher's Colony, Jakkasa... | 3.6 | 200 |
| 73 | Punjabi Rasoi | North Indian | Sector 3, HSR | 4.0 | 800 |
| 98 | Mandya Gowdru Donne Biryani | Biryani | HSR, HSR | 0.0 | 350 |
| 99 | Dindigul Thalapakatti Biriyani | North Indian | HSR, HSR | 4.1 | 650 |
| 101 | Easy Bites | Snacks, American | 9th Main Rd, Sector 6, HSR Layout, HSR | 3.8 | 200 |
| 107 | Junior Kuppanna | Chettinad, South Indian | Sector 6, HSR | 4.0 | 550 |
In [22]:
# Locations that contains "BTM"
swiggy_BTM=df_swiggy[df_swiggy["Location"].str.contains("BTM")]
swiggy_BTM
Out[22]:
| Shop_Name | Cuisine | Location | Rating | Cost_for_Two | |
|---|---|---|---|---|---|
| 6 | 99 VARIETY DOSA AND PAV BHAJI- Malli Mane Food... | Fast Food, North Indian, Chinese | BTM 2nd Stage, BTM | 4.1 | 200 |
| 7 | La Pino'z Pizza | Italian | BTM, BTM | 3.9 | 500 |
| 10 | Ambur Star Briyani | Chinese, South Indian, North Indian, Desserts,... | outer ring road, BTM | 4.1 | 500 |
| 17 | Sri Lakshmi Dhaba | North Indian | Bommanahalli, BTM | 3.7 | 200 |
| 20 | Just Bake - Cakes & confectioners | Desserts, Bakery | BTM 1st stage, BTM | 4.3 | 300 |
| 22 | Hotel Godavari | North Indian, Chinese, Hyderabadi | Marutinagar Main Road, BTM | 4.0 | 400 |
| 25 | Swad Punjab da | Indian | BTM, BTM | 4.1 | 250 |
| 27 | High N Hungry | Andhra, Biryani, Chinese, Desserts, Fast Food,... | 4th Cross, BTM | 4.1 | 350 |
| 31 | Bengali Fun Foods | North Indian | BTM 2nd stage, BTM | 4.2 | 300 |
| 33 | Oottupura | Kerala, South Indian | BTM, BTM | 4.3 | 268 |
| 35 | Hyderabadi Biryani Hub | North Indian, Chinese, Biryani | 3rd main, BTM | 3.9 | 450 |
| 40 | Venu's Donne Biryani | Biryani | Chocolate Factory Road, BTM | 4.3 | 300 |
| 42 | Swadista Aahar | South Indian, Snacks, North Indian, Chinese | 16th Main Road, 2nd Stage, BTM | 4.1 | 250 |
| 44 | Svadu Pure Ghee Sweets | Desserts, Fast Food, Sweets, Chaat | 1st Stage, BTM | 4.1 | 200 |
| 45 | Sai Abhiruchi | Chinese, South Indian, Andhra, Hyderabadi | BTM, BTM | 3.7 | 250 |
| 49 | Balaji's Veg | North Indian, Chinese, South Indian | Mico Layout, BTM | 4.1 | 300 |
| 51 | Donne Biryani Mandi | Biryani, Andhra, South Indian | BTM, BTM | 4.0 | 150 |
| 60 | calicut cafe restaurant | Fast Food, Beverages | BTM, BTM | 4.1 | 280 |
| 65 | World of asia | Beverages, Chinese | BTM, BTM | 4.0 | 250 |
| 66 | Ghar Ka Khana | North Indian | BTM, BTM | 4.2 | 220 |
| 68 | KANNUR FOOD POINT | Kerala, Chinese | SG palaya, BTM | 3.9 | 300 |
| 69 | KANNOOR RESTAURANT | North Indian, Chinese | BTM, BTM | 4.0 | 250 |
| 70 | Fattoush | Arabian, Beverages, Biryani, Chinese, Desserts... | BTM, BTM | 3.9 | 400 |
| 76 | BIRIYANI TASTE MASTH(BTM) | North Indian, South Indian | Btm, BTM | 4.2 | 300 |
| 79 | Tandoori Merchant | Andhra, Biryani, Chinese, Desserts, Fast Food,... | 4th Cross, BTM | 4.2 | 100 |
| 80 | Chinese Bae | Chinese, Thai | BTM, BTM | 4.5 | 450 |
| 83 | Abhiruchi Hotel | Chinese, Hyderabadi, Biryani, Indian, South In... | BTM, BTM | 4.0 | 250 |
| 84 | Punjabi Swag | Punjabi, North Indian, Chinese, Fast Food, Hea... | 16th Main Road, BTM | 3.7 | 400 |
| 86 | Gyaani Da Punjabi Dhaba | North Indian | 2nd Stage, BTM | 4.0 | 500 |
| 87 | Biriyani Bhatti | Biryani, Hyderabadi, Andhra, North Indian, Sou... | Kuvempu Nagar, Stage 2, BTM | 4.1 | 350 |
| 92 | BIRYANI CRAFTS | Indian | BTM, BTM | 4.1 | 500 |
| 104 | R.B Food Point | Chinese, North Indian | Jay Bheema Nagar, BTM | 3.7 | 350 |
| 106 | New Tasty Cafeteria | Andhra, Chettinad, Chinese, Mughlai, North Indian | Maruthi Nagar, BTM | 4.0 | 350 |
| 110 | Biryani Pot | North Indian, Biryani | Madiwala Junction, BTM | 4.0 | 500 |
| 114 | Savoury Restaurant | Arabian, Middle Eastern, North Indian, Grill, ... | Madiwala, BTM | 4.1 | 600 |
In [23]:
sns.histplot(swiggy_BTM["Rating"], bins=10) # bins = classes 0,2,4,4,6,
Out[23]:
<Axes: xlabel='Rating', ylabel='Count'>
In [24]:
sns.histplot(swiggy_BTM["Cost_for_Two"],bins=10)
Out[24]:
<Axes: xlabel='Cost_for_Two', ylabel='Count'>
In [25]:
# conclusion :
# BTM: Most has 4.0 to 4.2 Rating and Approx. cost for Two peoples lies between 200 to 350
In [26]:
sns.histplot(swiggy_HSR["Rating"], bins=10)
Out[26]:
<Axes: xlabel='Rating', ylabel='Count'>
In [27]:
sns.histplot(swiggy_HSR["Cost_for_Two"],bins=10)
Out[27]:
<Axes: xlabel='Cost_for_Two', ylabel='Count'>
In [28]:
sns.histplot(swiggy_Koramangala["Rating"],bins=10)
Out[28]:
<Axes: xlabel='Rating', ylabel='Count'>
In [29]:
sns.histplot(swiggy_Koramangala["Cost_for_Two"],bins=15)
Out[29]:
<Axes: xlabel='Cost_for_Two', ylabel='Count'>
In [30]:
# conclusion:
# Koramangala: Most has 4.0 to 4.3 Rating and Approx. Cost for Two people lies between 200 to 350.(max.Cost goes upto 600)
In [31]:
# Analysis "Approx Cost of 2 people " vs "Rating". Find out the relationship betwwen them.
df_Highest_Rated_Restaurants= df_swiggy[df_swiggy["Rating"]>= 4.0]
df_Highest_Rated_Restaurants
Out[31]:
| Shop_Name | Cuisine | Location | Rating | Cost_for_Two | |
|---|---|---|---|---|---|
| 0 | Kanti Sweets | Sweets | Koramangala, Koramangala | 4.3 | 150 |
| 1 | Mumbai Tiffin | North Indian, Home Food, Thalis, Combo | Sector 5, HSR | 4.4 | 400 |
| 2 | Sri Krishna sagar | South Indian, North Indian, Fast Food, Beverag... | 6th Block, Koramangala | 4.1 | 126 |
| 3 | Al Daaz | American, Arabian, Chinese, Desserts, Fast Foo... | HSR, HSR | 4.4 | 400 |
| 4 | Beijing Bites | Chinese, Thai | 5th Block, Koramangala | 4.1 | 450 |
| ... | ... | ... | ... | ... | ... |
| 111 | Bowl 99 | North Indian, South Indian | kormangala, Koramangala | 4.4 | 200 |
| 114 | Savoury Restaurant | Arabian, Middle Eastern, North Indian, Grill, ... | Madiwala, BTM | 4.1 | 600 |
| 115 | Royal Treat | North Indian, Chinese, Seafood, Biryani | 5th block Koramangala, Koramangala | 4.2 | 193 |
| 116 | Thali 99 | North Indian | Koramangala, Koramangala | 4.3 | 200 |
| 117 | Mani's Dum Biryani | Andhra, Biryani | 1st Block, Koramangala | 4.2 | 400 |
92 rows × 5 columns
In [32]:
df_Highest_Rated_Restaurants=df_Highest_Rated_Restaurants.loc[:, ["Shop_Name","Rating","Cost_for_Two"]]
df_Highest_Rated_Restaurants
Out[32]:
| Shop_Name | Rating | Cost_for_Two | |
|---|---|---|---|
| 0 | Kanti Sweets | 4.3 | 150 |
| 1 | Mumbai Tiffin | 4.4 | 400 |
| 2 | Sri Krishna sagar | 4.1 | 126 |
| 3 | Al Daaz | 4.4 | 400 |
| 4 | Beijing Bites | 4.1 | 450 |
| ... | ... | ... | ... |
| 111 | Bowl 99 | 4.4 | 200 |
| 114 | Savoury Restaurant | 4.1 | 600 |
| 115 | Royal Treat | 4.2 | 193 |
| 116 | Thali 99 | 4.3 | 200 |
| 117 | Mani's Dum Biryani | 4.2 | 400 |
92 rows × 3 columns
In [33]:
df_Highest_Rated_Restaurants=df_Highest_Rated_Restaurants.groupby(["Shop_Name","Rating"])["Cost_for_Two"].agg("mean") # series
df_Highest_Rated_Restaurants
Out[33]:
Shop_Name Rating
99 VARIETY DOSA AND JUICE-Malli mane food court 4.1 100.0
99 VARIETY DOSA AND PAV BHAJI- Malli Mane Food Court 4.1 200.0
A2B - Adyar Ananda Bhavan 4.2 450.0
Abhiruchi Hotel 4.0 250.0
Al Daaz 4.4 400.0
...
Venu's Donne Biryani 4.3 300.0
WarmOven Cake & Desserts 4.1 200.0
World of asia 4.0 250.0
XO Belgian Waffle 4.3 250.0
calicut cafe restaurant 4.1 280.0
Name: Cost_for_Two, Length: 91, dtype: float64
In [34]:
df_Highest_Rated_Restaurants=df_Highest_Rated_Restaurants.reset_index() # data frame
df_Highest_Rated_Restaurants
Out[34]:
| Shop_Name | Rating | Cost_for_Two | |
|---|---|---|---|
| 0 | 99 VARIETY DOSA AND JUICE-Malli mane food court | 4.1 | 100.0 |
| 1 | 99 VARIETY DOSA AND PAV BHAJI- Malli Mane Food... | 4.1 | 200.0 |
| 2 | A2B - Adyar Ananda Bhavan | 4.2 | 450.0 |
| 3 | Abhiruchi Hotel | 4.0 | 250.0 |
| 4 | Al Daaz | 4.4 | 400.0 |
| ... | ... | ... | ... |
| 86 | Venu's Donne Biryani | 4.3 | 300.0 |
| 87 | WarmOven Cake & Desserts | 4.1 | 200.0 |
| 88 | World of asia | 4.0 | 250.0 |
| 89 | XO Belgian Waffle | 4.3 | 250.0 |
| 90 | calicut cafe restaurant | 4.1 | 280.0 |
91 rows × 3 columns
In [35]:
import plotly.express as px
fig=px.scatter(
x=df_Highest_Rated_Restaurants["Cost_for_Two"],
y=df_Highest_Rated_Restaurants["Rating"],
color=df_Highest_Rated_Restaurants["Rating"],
size=df_Highest_Rated_Restaurants["Cost_for_Two"],
labels={
"x": "Approx. Cost_for_Two",
"y": "Rating",
"color":"Rating_Indicator"})
fig.update_layout(
template="plotly_dark",
title="Analysis 'Approx cost of2 people' vs 'rating'")
fig.show()
In [36]:
##Q Analysis Affodarble\Budgeted and Higest Rated Restaurants of Banglore:
df_Affordable_Restaurants=df_swiggy[(df_swiggy["Cost_for_Two"] <=500) & (df_swiggy["Rating"] >=4.0)]
df_Affordable_Restaurants
Out[36]:
| Shop_Name | Cuisine | Location | Rating | Cost_for_Two | |
|---|---|---|---|---|---|
| 0 | Kanti Sweets | Sweets | Koramangala, Koramangala | 4.3 | 150 |
| 1 | Mumbai Tiffin | North Indian, Home Food, Thalis, Combo | Sector 5, HSR | 4.4 | 400 |
| 2 | Sri Krishna sagar | South Indian, North Indian, Fast Food, Beverag... | 6th Block, Koramangala | 4.1 | 126 |
| 3 | Al Daaz | American, Arabian, Chinese, Desserts, Fast Foo... | HSR, HSR | 4.4 | 400 |
| 4 | Beijing Bites | Chinese, Thai | 5th Block, Koramangala | 4.1 | 450 |
| ... | ... | ... | ... | ... | ... |
| 110 | Biryani Pot | North Indian, Biryani | Madiwala Junction, BTM | 4.0 | 500 |
| 111 | Bowl 99 | North Indian, South Indian | kormangala, Koramangala | 4.4 | 200 |
| 115 | Royal Treat | North Indian, Chinese, Seafood, Biryani | 5th block Koramangala, Koramangala | 4.2 | 193 |
| 116 | Thali 99 | North Indian | Koramangala, Koramangala | 4.3 | 200 |
| 117 | Mani's Dum Biryani | Andhra, Biryani | 1st Block, Koramangala | 4.2 | 400 |
82 rows × 5 columns
In [37]:
df_Affordable_Restaurants=df_Affordable_Restaurants.groupby(["Shop_Name", "Rating"])["Cost_for_Two"].agg("mean")
df_Affordable_Restaurants=df_Affordable_Restaurants.reset_index()
df_Affordable_Restaurants
Out[37]:
| Shop_Name | Rating | Cost_for_Two | |
|---|---|---|---|
| 0 | 99 VARIETY DOSA AND JUICE-Malli mane food court | 4.1 | 100.0 |
| 1 | 99 VARIETY DOSA AND PAV BHAJI- Malli Mane Food... | 4.1 | 200.0 |
| 2 | A2B - Adyar Ananda Bhavan | 4.2 | 450.0 |
| 3 | Abhiruchi Hotel | 4.0 | 250.0 |
| 4 | Al Daaz | 4.4 | 400.0 |
| ... | ... | ... | ... |
| 76 | Venu's Donne Biryani | 4.3 | 300.0 |
| 77 | WarmOven Cake & Desserts | 4.1 | 200.0 |
| 78 | World of asia | 4.0 | 250.0 |
| 79 | XO Belgian Waffle | 4.3 | 250.0 |
| 80 | calicut cafe restaurant | 4.1 | 280.0 |
81 rows × 3 columns
In [38]:
df_Affordable_Restaurants.sort_values(by=["Rating"],ascending=False, inplace=True)
df_Affordable_Restaurants
Out[38]:
| Shop_Name | Rating | Cost_for_Two | |
|---|---|---|---|
| 41 | Khichdi Experiment | 4.8 | 200.0 |
| 54 | Natural Ice Cream | 4.6 | 150.0 |
| 21 | Corner House Ice Cream | 4.6 | 250.0 |
| 20 | Chinese Bae | 4.5 | 450.0 |
| 50 | Mumbai Tiffin | 4.4 | 400.0 |
| ... | ... | ... | ... |
| 55 | New Tasty Cafeteria | 4.0 | 350.0 |
| 53 | Nandhana Palace | 4.0 | 500.0 |
| 52 | Nanda's | 4.0 | 400.0 |
| 45 | Maa Di Hatti | 4.0 | 129.0 |
| 29 | Gyaani Da Punjabi Dhaba | 4.0 | 500.0 |
81 rows × 3 columns
In [39]:
plt.figure(figsize=(18,7))
sns.barplot(
x=df_Affordable_Restaurants["Shop_Name"],
y=df_Affordable_Restaurants["Cost_for_Two"],
data=df_Affordable_Restaurants)
Out[39]:
<Axes: xlabel='Shop_Name', ylabel='Cost_for_Two'>
In [40]:
plt.figure(figsize=(18,7))
sns.barplot(
x=df_Affordable_Restaurants["Shop_Name"],
y=df_Affordable_Restaurants["Cost_for_Two"],
data=df_Affordable_Restaurants)
plt.title(
"Affodarble\Budgeted and Higest Rated Restaurants (Banglore)",
fontsize=14,
fontweight="bold",
fontstyle="italic"
)
plt.xlabel("Shop_Name", fontsize=10, fontweight="bold")
plt.ylabel("Approx. Cost_for_Two", fontsize=10, fontweight="bold")
plt.xticks(rotation=90)
plt.show()
In [41]:
#Q Top 15 cheapest & Highest Rated Restaurants with Approx. Cost for 2 people:
df_chepest_Restaurants=df_Affordable_Restaurants.sort_values(by="Cost_for_Two", ascending=True)
df_chepest_Restaurants
Out[41]:
| Shop_Name | Rating | Cost_for_Two | |
|---|---|---|---|
| 72 | Tandoori Merchant | 4.2 | 100.0 |
| 0 | 99 VARIETY DOSA AND JUICE-Malli mane food court | 4.1 | 100.0 |
| 51 | NIC Natural Ice Creams | 4.2 | 120.0 |
| 68 | Sri Krishna sagar | 4.1 | 126.0 |
| 45 | Maa Di Hatti | 4.0 | 129.0 |
| ... | ... | ... | ... |
| 5 | Ambur Star Briyani | 4.1 | 500.0 |
| 7 | BIRYANI CRAFTS | 4.1 | 500.0 |
| 53 | Nandhana Palace | 4.0 | 500.0 |
| 46 | Madeena Hotel | 4.1 | 500.0 |
| 29 | Gyaani Da Punjabi Dhaba | 4.0 | 500.0 |
81 rows × 3 columns
In [42]:
fig=px.bar(
data_frame=df_chepest_Restaurants,
x=df_chepest_Restaurants["Shop_Name"][0:15],
y=df_chepest_Restaurants["Cost_for_Two"][0:15],
color=df_chepest_Restaurants["Rating"][0:15],
labels={
"x": "Restaurant_Name",
"y": "Approx. Cost_for_Two (₹ )",
"color": "Rating",})
fig.update_layout(
template="plotly_dark",
title="Top 15 Cheapest & Highesty Rated Restaurants with Approx. Cost for 2 People")
fig.show()
In [43]:
fig=px.scatter(
data_frame=df_chepest_Restaurants,
x=df_chepest_Restaurants["Shop_Name"][0:15],
y=df_chepest_Restaurants["Cost_for_Two"][0:15],
color=df_chepest_Restaurants["Rating"][0:15],
labels={
"x": "Restaurant_Name",
"y": "Approx. Cost_for_Two (₹ )",
"color": "Rating",})
fig.update_layout(
template="plotly_dark",
title="Top 15 Cheapest & Highesty Rated Restaurants with Approx. Cost for 2 People")
fig.show()
In [44]:
# Q Top 15 expensive & Highest Rated Restaurants with Approx. Cost For 2 People:
df_Expensive_Restaurants=df_Highest_Rated_Restaurants.sort_values(
by="Cost_for_Two", ascending=False)
df_Expensive_Restaurants
Out[44]:
| Shop_Name | Rating | Cost_for_Two | |
|---|---|---|---|
| 67 | Punjabi Rasoi | 4.0 | 800.0 |
| 26 | Dindigul Thalapakatti Biriyani | 4.1 | 650.0 |
| 73 | Savoury Restaurant | 4.1 | 600.0 |
| 81 | Taco Bell | 4.3 | 600.0 |
| 66 | Pizza Hut | 4.0 | 600.0 |
| ... | ... | ... | ... |
| 49 | Maa Di Hatti | 4.0 | 129.0 |
| 77 | Sri Krishna sagar | 4.1 | 126.0 |
| 56 | NIC Natural Ice Creams | 4.2 | 120.0 |
| 82 | Tandoori Merchant | 4.2 | 100.0 |
| 0 | 99 VARIETY DOSA AND JUICE-Malli mane food court | 4.1 | 100.0 |
91 rows × 3 columns
In [45]:
fig=px.bar(
data_frame=df_Expensive_Restaurants,
x=df_Expensive_Restaurants["Shop_Name"][0:15],
y=df_Expensive_Restaurants["Cost_for_Two"][0:15],
color=df_Expensive_Restaurants["Rating"][0:15],
labels={
"x": "Restaurant_Name",
"y": "Approx. Cost_for_Two (₹ )",
"color": "Rating",})
fig.update_layout(
template="plotly_dark",
title="Top 15 Expensive & Highesty Rated Restaurants with Approx. Cost for 2 People")
fig.show()
In [46]:
fig=px.scatter(
data_frame=df_Expensive_Restaurants,
x=df_Expensive_Restaurants["Shop_Name"][0:15],
y=df_Expensive_Restaurants["Cost_for_Two"][0:15],
color=df_Expensive_Restaurants["Rating"][0:15],
labels={
"x": "Restaurant_Name",
"y": "Approx. Cost_for_Two (₹ )",
"color": "Rating",})
fig.update_layout(
template="plotly_dark",
title="Top 15 Expensive & Highesty Rated Restaurants with Approx. Cost for 2 People")
fig.show()
In [47]:
# CUISINE ANALYSIS
df_swiggy["Cuisine"]= df_swiggy["Cuisine"].str.title()
df_swiggy["Cuisine"]
Out[47]:
0 Sweets
1 North Indian, Home Food, Thalis, Combo
2 South Indian, North Indian, Fast Food, Beverag...
3 American, Arabian, Chinese, Desserts, Fast Foo...
4 Chinese, Thai
...
113 Pan-Asian, Chinese, Asian
114 Arabian, Middle Eastern, North Indian, Grill, ...
115 North Indian, Chinese, Seafood, Biryani
116 North Indian
117 Andhra, Biryani
Name: Cuisine, Length: 118, dtype: object
In [48]:
df_swiggy["Cuisine"].unique()
Out[48]:
array(['Sweets', 'North Indian, Home Food, Thalis, Combo',
'South Indian, North Indian, Fast Food, Beverages, Jain',
'American, Arabian, Chinese, Desserts, Fast Food, Mughlai, North Indian',
'Chinese, Thai', 'North Indian',
'Fast Food, North Indian, Chinese', 'Italian',
'South Indian, Kerala, Chinese, North Indian',
'Pizzas, Italian, Mexican',
'Chinese, South Indian, North Indian, Desserts, Fast Food, Kerala, Andhra, Beverages, Mughlai, Seafood',
'Desserts', 'Chinese, Andhra, Biryani, Seafood', 'Chinese',
'South Indian, Chinese, Desserts, North Indian',
'Arabian, Fast Food', 'Desserts, Beverages', 'Indian, Rajasthani',
'Desserts, Bakery', 'Chinese, Healthy Food, North Indian',
'North Indian, Chinese, Hyderabadi', 'Fast Food',
'Chinese, Jain, North Indian, South Indian', 'Indian',
'North Indian, South Indian, Chinese',
'Andhra, Biryani, Chinese, Desserts, Fast Food, Seafood, South Indian',
'American, Fast Food',
'Biryani, Seafood, North Indian, Chinese, Desserts, Andhra, South Indian',
'Snacks, American', 'South Indian', 'Kerala, South Indian',
'Mexican', 'North Indian, Chinese, Biryani',
'Turkish, Portuguese, American', 'Biryani',
'South Indian, Snacks, North Indian, Chinese',
'Desserts, Fast Food, Sweets, Chaat',
'Chinese, South Indian, Andhra, Hyderabadi', 'Pizzas, Fast Food',
'Biryani, Mughlai, South Indian', 'Chinese, Asian',
'North Indian, Chinese, South Indian', 'Italian, Desserts, Pizzas',
'Biryani, Andhra, South Indian',
'Chinese, Continental, Italian, Mediterranean, Thai, Lebanese, American, Asian, Beverages, Bakery, Biryani, Cafe, Desserts, Healthy Food, Mexican, North Indian, Salads, Pizzas',
'Pizzas, Chinese, Pastas, Salads, American, Continental',
'Andhra, Biryani',
'Chinese, South Indian, North Indian, Fast Food',
'Fast Food, Beverages',
'Biryani, South Indian, North Indian, Fast Food, Andhra, Beverages, Mughlai, Seafood, Punjabi, Hyderabadi, Chinese',
'Beverages, Chinese',
'South Indian, Biryani, Kerala, North Indian, Chinese',
'Kerala, Chinese', 'North Indian, Chinese',
'Arabian, Beverages, Biryani, Chinese, Desserts, North Indian',
'Biryani, Juices, Kebabs', 'Andhra, South Indian',
'Beverages, Cafe, Snacks', 'North Indian, South Indian',
'Turkish, Portuguese, American, Grill',
'Home Food, Healthy Food, Indian', 'Ice Cream',
'Chinese, Hyderabadi, Biryani, Indian, South Indian, Andhra, Tandoor',
'Punjabi, North Indian, Chinese, Fast Food, Healthy Food, Mughlai, Desserts',
'American',
'Biryani, Hyderabadi, Andhra, North Indian, South Indian',
'Fast Food, Juices, North Indian',
'North Indian, Chaat, Snacks, Fast Food',
'Desserts, Mughlai, Seafood', 'Ice Cream, Desserts',
'Chinese, North Indian', 'Biryani, Kebabs',
'Andhra, Chettinad, Chinese, Mughlai, North Indian',
'Chettinad, South Indian',
'Continental, Indian, Pan-Asian, Oriental',
'North Indian, Biryani', 'Pan-Asian, Chinese, Asian',
'Arabian, Middle Eastern, North Indian, Grill, Seafood, Kerala, Chinese',
'North Indian, Chinese, Seafood, Biryani'], dtype=object)
In [49]:
# lstrip is removed the space
freq_dict={}
for i in df_swiggy["Cuisine"].unique():
Cuisines_lists=i.split(",")
for Cuisine in Cuisines_lists:
Cuisine=Cuisine.lstrip(" ")
if Cuisine in freq_dict:
freq_dict[Cuisine]= freq_dict[Cuisine] + 1
else:
freq_dict[Cuisine]= 1
print(freq_dict)
print()
print("Total Records: \t", len(freq_dict))
{'Sweets': 2, 'North Indian': 32, 'Home Food': 2, 'Thalis': 1, 'Combo': 1, 'South Indian': 23, 'Fast Food': 16, 'Beverages': 9, 'Jain': 2, 'American': 8, 'Arabian': 4, 'Chinese': 35, 'Desserts': 15, 'Mughlai': 7, 'Thai': 2, 'Italian': 4, 'Kerala': 6, 'Pizzas': 5, 'Mexican': 3, 'Andhra': 12, 'Seafood': 8, 'Biryani': 18, 'Indian': 5, 'Rajasthani': 1, 'Bakery': 2, 'Healthy Food': 4, 'Hyderabadi': 5, 'Snacks': 4, 'Turkish': 2, 'Portuguese': 2, 'Chaat': 2, 'Asian': 3, 'Continental': 3, 'Mediterranean': 1, 'Lebanese': 1, 'Cafe': 2, 'Salads': 2, 'Pastas': 1, 'Punjabi': 2, 'Juices': 2, 'Kebabs': 2, 'Grill': 2, 'Ice Cream': 2, 'Tandoor': 1, 'Chettinad': 2, 'Pan-Asian': 2, 'Oriental': 1, 'Middle Eastern': 1}
Total Records: 48
In [50]:
# Extracting Cuisine name and there frequency
Cuisine = freq_dict.keys()
freq= freq_dict.values()
df_Cuisine_Analysis= pd.DataFrame()
# Creating a dataframe having two features-----> Cuisine and count
df_Cuisine_Analysis["Cuisine"]= Cuisine
df_Cuisine_Analysis["Count"]= freq
df_Cuisine_Analysis
Out[50]:
| Cuisine | Count | |
|---|---|---|
| 0 | Sweets | 2 |
| 1 | North Indian | 32 |
| 2 | Home Food | 2 |
| 3 | Thalis | 1 |
| 4 | Combo | 1 |
| 5 | South Indian | 23 |
| 6 | Fast Food | 16 |
| 7 | Beverages | 9 |
| 8 | Jain | 2 |
| 9 | American | 8 |
| 10 | Arabian | 4 |
| 11 | Chinese | 35 |
| 12 | Desserts | 15 |
| 13 | Mughlai | 7 |
| 14 | Thai | 2 |
| 15 | Italian | 4 |
| 16 | Kerala | 6 |
| 17 | Pizzas | 5 |
| 18 | Mexican | 3 |
| 19 | Andhra | 12 |
| 20 | Seafood | 8 |
| 21 | Biryani | 18 |
| 22 | Indian | 5 |
| 23 | Rajasthani | 1 |
| 24 | Bakery | 2 |
| 25 | Healthy Food | 4 |
| 26 | Hyderabadi | 5 |
| 27 | Snacks | 4 |
| 28 | Turkish | 2 |
| 29 | Portuguese | 2 |
| 30 | Chaat | 2 |
| 31 | Asian | 3 |
| 32 | Continental | 3 |
| 33 | Mediterranean | 1 |
| 34 | Lebanese | 1 |
| 35 | Cafe | 2 |
| 36 | Salads | 2 |
| 37 | Pastas | 1 |
| 38 | Punjabi | 2 |
| 39 | Juices | 2 |
| 40 | Kebabs | 2 |
| 41 | Grill | 2 |
| 42 | Ice Cream | 2 |
| 43 | Tandoor | 1 |
| 44 | Chettinad | 2 |
| 45 | Pan-Asian | 2 |
| 46 | Oriental | 1 |
| 47 | Middle Eastern | 1 |
In [51]:
plt.figure(figsize=(20,8))
sns.barplot(
x=df_Cuisine_Analysis["Cuisine"],
y=df_Cuisine_Analysis["Count"],
data=df_Cuisine_Analysis,)
plt.xticks(rotation=90)
plt.title(
"Cuisine Overall Analysis (Banglore)",
fontsize=14,
fontweight="bold",
fontstyle="italic",)
plt.xlabel("Cuisine", fontsize=11, fontweight="bold")
plt.ylabel("Number of Restaurants", fontsize=11, fontweight="bold")
plt.show()
In [52]:
fig=px.pie(
data_frame=df_Cuisine_Analysis,
names=df_Cuisine_Analysis["Cuisine"][:10],
values=df_Cuisine_Analysis["Count"][:10],
title="Distribution of Cuisine in Banglore Restaurants",width=700,height=700)
# fig.update_traces(textpostition"inside",textinfo="percent+label(")
fig.show()
In [53]:
freq_BTM={}
for i in swiggy_BTM["Cuisine"].unique():
Cuisines_lists=i.split(",")
for Cuisine in Cuisines_lists:
Cuisine=Cuisine.lstrip(" ")
if Cuisine in freq_BTM:
freq_BTM[Cuisine]= freq_BTM[Cuisine] + 1
else:
freq_BTM[Cuisine]= 1
print(freq_BTM)
print()
print("Total Records: \t", len(freq_BTM))
{'Fast Food': 6, 'North Indian': 16, 'Chinese': 18, 'Italian': 1, 'South Indian': 10, 'Desserts': 6, 'Kerala': 4, 'Andhra': 7, 'Beverages': 4, 'Mughlai': 3, 'Seafood': 3, 'Bakery': 1, 'Hyderabadi': 4, 'Indian': 2, 'Biryani': 8, 'Snacks': 1, 'Sweets': 1, 'Chaat': 1, 'Arabian': 2, 'Thai': 1, 'Tandoor': 1, 'Punjabi': 1, 'Healthy Food': 1, 'Chettinad': 1, 'Middle Eastern': 1, 'Grill': 1}
Total Records: 26
In [54]:
freq_BTM.keys()
Out[54]:
dict_keys(['Fast Food', 'North Indian', 'Chinese', 'Italian', 'South Indian', 'Desserts', 'Kerala', 'Andhra', 'Beverages', 'Mughlai', 'Seafood', 'Bakery', 'Hyderabadi', 'Indian', 'Biryani', 'Snacks', 'Sweets', 'Chaat', 'Arabian', 'Thai', 'Tandoor', 'Punjabi', 'Healthy Food', 'Chettinad', 'Middle Eastern', 'Grill'])
In [55]:
Cusisne=freq_BTM.keys()
freq=freq_BTM.values()
dict_BTM={"Cuisine": Cusisne, "Count": freq}
df_Cuisine_BTM=pd.DataFrame(dict_BTM)
df_Cuisine_BTM.head()
Out[55]:
| Cuisine | Count | |
|---|---|---|
| 0 | Fast Food | 6 |
| 1 | North Indian | 16 |
| 2 | Chinese | 18 |
| 3 | Italian | 1 |
| 4 | South Indian | 10 |
In [56]:
plt.figure(figsize=(20,8))
sns.barplot(
x=df_Cuisine_BTM["Cuisine"],y=df_Cuisine_BTM["Count"],data=df_Cuisine_BTM)
plt.xticks(rotation=90)
plt.title(
"Cuisine Overall BTM (Banglore)",
fontsize=14,
fontweight="bold",
fontstyle="italic",)
plt.xlabel("Cuisine", fontsize=11, fontweight="bold")
plt.ylabel("Number of Restaurants", fontsize=11,fontweight="bold")
plt.show()
In [57]:
freq_HSR={}
for i in swiggy_HSR["Cuisine"].unique():
Cuisines_lists=i.split(",")
for Cuisine in Cuisines_lists:
Cuisine=Cuisine.lstrip(" ")
if Cuisine in freq_HSR:
freq_HSR[Cuisine]= freq_HSR[Cuisine] + 1
else:
freq_HSR[Cuisine]= 1
print(freq_HSR)
print()
print("Total Records: \t", len(freq_HSR))
{'North Indian': 6, 'Home Food': 1, 'Thalis': 1, 'Combo': 1, 'American': 3, 'Arabian': 1, 'Chinese': 4, 'Desserts': 3, 'Fast Food': 1, 'Mughlai': 1, 'South Indian': 4, 'Kerala': 1, 'Indian': 1, 'Rajasthani': 1, 'Jain': 1, 'Biryani': 4, 'Turkish': 1, 'Portuguese': 1, 'Andhra': 1, 'Bakery': 1, 'Juices': 1, 'Kebabs': 1, 'Snacks': 1, 'Chettinad': 1}
Total Records: 24
In [58]:
Cuisine=freq_HSR.keys()
freq=freq_HSR.values()
dict_HSR={"Cuisine": Cuisine, "Count": freq}
df_Cuisine_HSR=pd.DataFrame(dict_HSR)
df_Cuisine_HSR.head()
Out[58]:
| Cuisine | Count | |
|---|---|---|
| 0 | North Indian | 6 |
| 1 | Home Food | 1 |
| 2 | Thalis | 1 |
| 3 | Combo | 1 |
| 4 | American | 3 |
In [59]:
plt.figure(figsize=(20,8))
sns.barplot(
x=df_Cuisine_HSR["Cuisine"],y=df_Cuisine_HSR["Count"],data=df_Cuisine_HSR)
plt.xticks(rotation=90)
plt.title(
"Cuisine Overall HSR (Banglore)",
fontsize=14,
fontweight="bold",
fontstyle="italic",)
plt.xlabel("Cuisine", fontsize=11, fontweight="bold")
plt.ylabel("Number of Restaurants", fontsize=11,fontweight="bold")
plt.show()
In [60]:
fig=px.pie(
data_frame=df_Cuisine_HSR,
names=df_Cuisine_HSR["Cuisine"][:10],
values=df_Cuisine_HSR["Count"][:10],
title="Distribution of Cuisine in Banglore Restaurants",width=700,height=700)
# fig.update_traces(textpostition"inside",textinfo="percent+label(")
fig.show()
In [61]:
freq_koramangala={}
for i in swiggy_Koramangala["Cuisine"].unique():
Cuisines_lists=i.split(",")
for Cuisine in Cuisines_lists:
Cuisine=Cuisine.lstrip(" ")
if Cuisine in freq_koramangala:
freq_koramangala[Cuisine]= freq_koramangala[Cuisine] + 1
else:
freq_koramangala[Cuisine]= 1
print(freq_koramangala)
print()
print("Total Records: \t", len(freq_koramangala))
{'Sweets': 1, 'South Indian': 11, 'North Indian': 14, 'Fast Food': 9, 'Beverages': 5, 'Jain': 1, 'Chinese': 15, 'Thai': 2, 'Pizzas': 5, 'Italian': 4, 'Mexican': 3, 'Desserts': 8, 'Andhra': 5, 'Biryani': 10, 'Seafood': 5, 'Arabian': 1, 'Healthy Food': 3, 'American': 6, 'Snacks': 3, 'Mughlai': 3, 'Asian': 3, 'Continental': 3, 'Mediterranean': 1, 'Lebanese': 1, 'Bakery': 1, 'Cafe': 2, 'Salads': 2, 'Pastas': 1, 'Punjabi': 1, 'Hyderabadi': 1, 'Kerala': 1, 'Turkish': 1, 'Portuguese': 1, 'Grill': 1, 'Home Food': 1, 'Indian': 2, 'Ice Cream': 2, 'Juices': 1, 'Chaat': 1, 'Kebabs': 1, 'Pan-Asian': 2, 'Oriental': 1}
Total Records: 42
In [124]:
Cuisine=freq_koramangala.keys()
freq=freq_koramangala.values()
dict_koramangala={"Cuisine": Cuisine, "Count": freq}
df_Cuisine_koramangala=pd.DataFrame(dict_HSR)
df_Cuisine_koramangala.head()
Out[124]:
| Cuisine | Count | |
|---|---|---|
| 0 | North Indian | 6 |
| 1 | Home Food | 1 |
| 2 | Thalis | 1 |
| 3 | Combo | 1 |
| 4 | American | 3 |
In [ ]: